package  
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	public class treechild extends Sprite 
	{
		static public const TREE_CHILD_WIDTH:int = 25;
		static public const TREE_CHILD_MARGIN:int = 3;
		static public const TREE_CHILD_RADIUS:int = 12;
		
		public var title:					TextField 		= new TextField();
		public var color:					int;	
		public var stones:					Array 			= [];
		public var move_number:				int 			= 0;
		public var old_stone:				Array 			= [null,null];
		
		public function treechild(color:int, move_number:int, old_stone:Array) 
		{
			this.color = color;
			this.move_number = move_number;
			this.old_stone = old_stone;
			graphics.beginFill(color == stone.COLOR_BLACK? 0:0xFFFFFF, 1);
			graphics.drawCircle(0, 0, TREE_CHILD_RADIUS);
			graphics.endFill();
			graphics.lineStyle(1, 0);
			graphics.drawCircle(0, 0, TREE_CHILD_RADIUS);
			title.mouseEnabled = false;
			title.text = '';
			title.width = 25;
			title.height = 15;
			//title.textColor = color == stone.COLOR_BLACK ? 0xFFFFFF : 0;
			addChild(title);
			for each (var t:Array in board.stones)
			{
				stones.push(t);
			}
			addEventListener(MouseEvent.CLICK, on_click);
		}
		
		private function on_click(e:MouseEvent):void 
		{
			return;
			/*var curX:int = Main.brd.get_board_coord_x(e.stageX);
			var curY:int = Main.brd.get_board_coord_y(e.stageY);
			if (move_number != board.move_number)
				board.is_view_mode = true;
			else
				board.is_view_mode = false;
			for each (t in board.stones_symbs)
			{
				for each (var t2:DisplayObject in t) 
				{
					if (t2)
						Main.brd.removeChild(t2);
				}
				
			}
			for each (var t:Array in stones)
			{
				board.stones.push(t);
			}
			Main.brd.clean_stone_arrays();
			for each (t in board.stones)
			{
				for each (var t2:DisplayObject in t) 
				{
					stones[curX - 1][curY - 1] = (current_color == stone.COLOR_BLACK? 1:2);
					var nextstone:stone = new stone(current_color, current_coord_x(e.stageX), current_coord_y(e.stageY), CELL_WIDTH / 2);
					addChild(nextstone);
				}
				
			}*/
		}
		
	}

}





